package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;

@Getter
@Setter
public class Notice {

    private Long id;
    //发布人
    private Employee issuer;
    //发布时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date pubdate;
    //标题
    private String title;
    //内容
    private String content;
    //是否已读
    private boolean read;

    public String getJson(){
        HashMap map = new HashMap();
        map.put("id",id);
        map.put("title",title);
        map.put("content",content);
        return JSON.toJSONString(map);
    }


}